# Copyright (c) 2008 Agostino Russo
#
# Written by Agostino Russo <agostino.russo@gmail.com>
#
# This file is part of Wubi the Win32 Ubuntu Installer.
#
# Wubi is free software; you can redistribute it and/or modify
# it under 5the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of
# the License, or (at your option) any later version.
#
# Wubi is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

'''
Generic mappings
'''

name2country  = {
    "Afghanistan" : "AF",
    "Aland Islands" : "AX",
    "Albania" : "AL",
    "Algeria" : "DZ",
    "American Samoa" : "AS",
    "Andorra" : "AD",
    "Angola" : "AO",
    "Anguilla" : "AI",
    "Antarctica" : "AQ",
    "Antigua and Barbuda" : "AG",
    "Argentina" : "AR",
    "Armenia" : "AM",
    "Aruba" : "AW",
    "Australia" : "AU",
    "Austria" : "AT",
    "Azerbaijan" : "AZ",
    "Bahamas" : "BS",
    "Bahrain" : "BH",
    "Bangladesh" : "BD",
    "Barbados" : "BB",
    "Belarus" : "BY",
    "Belgium" : "BE",
    "Belize" : "BZ",
    "Benin" : "BJ",
    "Bermuda" : "BM",
    "Bhutan" : "BT",
    "Bolivia" : "BO",
    "Bosnia and Herzegovina" : "BA",
    "Botswana" : "BW",
    "Brazil" : "BR",
    "British Indian Ocean Territory" : "IO",
    "Brunei Darussalam" : "BN",
    "Bulgaria" : "BG",
    "Burkina Faso" : "BF",
    "Burundi" : "BI",
    "Cambodia" : "KH",
    "Cameroon" : "CM",
    "Canada" : "CA",
    "Cape Verde" : "CV",
    "Cayman Islands" : "KY",
    "Central African Republic" : "CF",
    "Chad" : "TD",
    "Chile" : "CL",
    "China" : "CN",
    "Christmas Island" : "CX",
    "Cocos (Keeling) Islands" : "CC",
    "Colombia" : "CO",
    "Comoros" : "KM",
    "Congo" : "CG",
    "Congo, the Democratic Republic of the" : "CD",
    "Cook Islands" : "CK",
    "Costa Rica" : "CR",
    "Cote d'Ivoire" : "CI",
    "Croatia" : "HR",
    "Cuba" : "CU",
    "Cyprus" : "CY",
    "Czech Republic" : "CZ",
    "Denmark" : "DK",
    "Djibouti" : "DJ",
    "Dominica" : "DM",
    "Dominican Republic" : "DO",
    "Ecuador" : "EC",
    "Egypt" : "EG",
    "El Salvador" : "SV",
    "Equatorial Guinea" : "GQ",
    "Eritrea" : "ER",
    "Estonia" : "EE",
    "Ethiopia" : "ET",
    "Falkland Islands (Malvinas)" : "FK",
    "Faroe Islands" : "FO",
    "Fiji" : "FJ",
    "Finland" : "FI",
    "France" : "FR",
    "French Guiana" : "GF",
    "French Polynesia" : "PF",
    "French Southern Territories" : "TF",
    "Gabon" : "GA",
    "Gambia" : "GM",
    "Georgia" : "GE",
    "Germany" : "DE",
    "Ghana" : "GH",
    "Gibraltar" : "GI",
    "Greece" : "GR",
    "Greenland" : "GL",
    "Grenada" : "GD",
    "Guadeloupe" : "GP",
    "Guam" : "GU",
    "Guatemala" : "GT",
    "Guernsey" : "GG",
    "Guinea-Bissau" : "GW",
    "Guinea" : "GN",
    "Guyana" : "GY",
    "Haiti" : "HT",
    "Holy See (Vatican City State)" : "VA",
    "Honduras" : "HN",
    "Hong Kong" : "HK",
    "Hungary" : "HU",
    "Iceland" : "IS",
    "India" : "IN",
    "Indonesia" : "ID",
    "Iran, Islamic Republic of" : "IR",
    "Iraq" : "IQ",
    "Ireland" : "IE",
    "Isle of Man" : "IM",
    "Israel" : "IL",
    "Italy" : "IT",
    "Jamaica" : "JM",
    "Japan" : "JP",
    "Jersey" : "JE",
    "Jordan" : "JO",
    "Kazakhstan" : "KZ",
    "Kenya" : "KE",
    "Kiribati" : "KI",
    "Korea, Democratic People's Republic of" : "KP",
    "Korea, Republic of" : "KR",
    "Kuwait" : "KW",
    "Kyrgyzstan" : "KG",
    "Lao People's Democratic Republic" : "LA",
    "Latvia" : "LV",
    "Lebanon" : "LB",
    "Lesotho" : "LS",
    "Liberia" : "LR",
    "Libyan Arab Jamahiriya" : "LY",
    "Liechtenstein" : "LI",
    "Lithuania" : "LT",
    "Luxembourg" : "LU",
    "Macao" : "MO",
    "Macedonia, the former Yugoslav Republic of" : "MK",
    "Madagascar" : "MG",
    "Malawi" : "MW",
    "Malaysia" : "MY",
    "Maldives" : "MV",
    "Mali" : "ML",
    "Malta" : "MT",
    "Marshall Islands" : "MH",
    "Martinique" : "MQ",
    "Mauritania" : "MR",
    "Mauritius" : "MU",
    "Mayotte" : "YT",
    "Mexico" : "MX",
    "Micronesia, Federated States of" : "FM",
    "Moldova, Republic of" : "MD",
    "Monaco" : "MC",
    "Mongolia" : "MN",
    "Montenegro" : "ME",
    "Montserrat" : "MS",
    "Morocco" : "MA",
    "Mozambique" : "MZ",
    "Myanmar" : "MM",
    "Namibia" : "NA",
    "Nauru" : "NR",
    "Nepal" : "NP",
    "Netherlands Antilles" : "AN",
    "Netherlands" : "NL",
    "New Caledonia" : "NC",
    "New Zealand" : "NZ",
    "Nicaragua" : "NI",
    "Nigeria" : "NG",
    "Niger" : "NE",
    "Niue" : "NU",
    "Norfolk Island" : "NF",
    "Northern Mariana Islands" : "MP",
    "Norway" : "NO",
    "Oman" : "OM",
    "Pakistan" : "PK",
    "Palau" : "PW",
    "Palestinian Territory, Occupied" : "PS",
    "Panama" : "PA",
    "Papua New Guinea" : "PG",
    "Paraguay" : "PY",
    "Peru" : "PE",
    "Philippines" : "PH",
    "Pitcairn" : "PN",
    "Poland" : "PL",
    "Portugal" : "PT",
    "Puerto Rico" : "PR",
    "Qatar" : "QA",
    "Reunion" : "RE",
    "Romania" : "RO",
    "Russian Federation" : "RU",
    "Rwanda" : "RW",
    "Saint Helena" : "SH",
    "Saint Kitts and Nevis" : "KN",
    "Saint Lucia" : "LC",
    "Saint Pierre and Miquelon" : "PM",
    "Saint Vincent and the Grenadines" : "VC",
    "Samoa" : "WS",
    "San Marino" : "SM",
    "Sao Tome and Principe" : "ST",
    "Saudi Arabia" : "SA",
    "Senegal" : "SN",
    "Serbia" : "RS",
    "Seychelles" : "SC",
    "Sierra Leone" : "SL",
    "Singapore" : "SG",
    "Slovakia" : "SK",
    "Slovenia" : "SI",
    "Solomon Islands" : "SB",
    "Somalia" : "SO",
    "South Africa" : "ZA",
    "South Georgia and the South Sandwich Islands" : "GS",
    "Spain" : "ES",
    "Sri Lanka" : "LK",
    "Sudan" : "SD",
    "Suriname" : "SR",
    "Svalbard and Jan Mayen" : "SJ",
    "Swaziland" : "SZ",
    "Sweden" : "SE",
    "Switzerland" : "CH",
    "Syrian Arab Republic" : "SY",
    "Taiwan, Province of China" : "TW",
    "Tajikistan" : "TJ",
    "Tanzania, United Republic of" : "TZ",
    "Thailand" : "TH",
    "Timor-Leste" : "TL",
    "Togo" : "TG",
    "Tokelau" : "TK",
    "Tonga" : "TO",
    "Trinidad and Tobago" : "TT",
    "Tunisia" : "TN",
    "Turkey" : "TR",
    "Turkmenistan" : "TM",
    "Turks and Caicos Islands" : "TC",
    "Tuvalu" : "TV",
    "Uganda" : "UG",
    "Ukraine" : "UA",
    "United Arab Emirates" : "AE",
    "United Kingdom" : "GB",
    "United States Minor Outlying Islands" : "UM",
    "United States" : "US",
    "Uruguay" : "UY",
    "Uzbekistan" : "UZ",
    "Vanuatu" : "VU",
    "Venezuela" : "VE",
    "Viet Nam" : "VN",
    "Virgin Islands, British" : "VG",
    "Virgin Islands, U.S." : "VI",
    "Wallis and Futuna" : "WF",
    "Western Sahara" : "EH",
    "Yemen" : "YE",
    "Zambia" : "ZM",
    "Zimbabwe" : "ZW",
}

lang_country2linux_locale = {
    "aa_DJ" : "aa_DJ.UTF-8",
    "aa_ER" : "aa_ER",
    "aa_ET" : "aa_ET",
    "af_ZA" : "af_ZA.UTF-8",
    "am_ET" : "am_ET",
    "an_ES" : "an_ES.UTF-8",
    "ar_AE" : "ar_AE.UTF-8",
    "ar_BH" : "ar_BH.UTF-8",
    "ar_DZ" : "ar_DZ.UTF-8",
    "ar_EG" : "ar_EG.UTF-8",
    "ar_IN" : "ar_IN",
    "ar_IQ" : "ar_IQ.UTF-8",
    "ar_JO" : "ar_JO.UTF-8",
    "ar_KW" : "ar_KW.UTF-8",
    "ar_LB" : "ar_LB.UTF-8",
    "ar_LY" : "ar_LY.UTF-8",
    "ar_MA" : "ar_MA.UTF-8",
    "ar_OM" : "ar_OM.UTF-8",
    "ar_QA" : "ar_QA.UTF-8",
    "ar_SA" : "ar_SA.UTF-8",
    "ar_SD" : "ar_SD.UTF-8",
    "ar_SY" : "ar_SY.UTF-8",
    "ar_TN" : "ar_TN.UTF-8",
    "ar_YE" : "ar_YE.UTF-8",
    "az_AZ" : "az_AZ.UTF-8",
    "as_IN" : "as_IN.UTF-8",
    "ast_ES" : "ast_ES.UTF-8",
    "be_BY" : "be_BY.UTF-8",
    "bg_BG" : "bg_BG.UTF-8",
    "bn_BD" : "bn_BD",
    "bn_IN" : "bn_IN",
    "br_FR" : "br_FR.UTF-8",
    "bs_BA" : "bs_BA.UTF-8",
    "byn_ER" : "byn_ER",
    "ca_AD" : "ca_AD.UTF-8",
    "ca_ES" : "ca_ES.UTF-8",
    "ca_FR" : "ca_FR.UTF-8",
    "ca_IT" : "ca_IT.UTF-8",
    "crh_UA" : "crh_UA",
    "cs_CZ" : "cs_CZ.UTF-8",
    "csb_PL" : "csb_PL",
    "cy_GB" : "cy_GB.UTF-8",
    "da_DK" : "da_DK.UTF-8",
    "de_AT" : "de_AT.UTF-8",
    "de_BE" : "de_BE.UTF-8",
    "de_CH" : "de_CH.UTF-8",
    "de_DE" : "de_DE.UTF-8",
    "de_LU" : "de_LU.UTF-8",
    "dz_BT" : "dz_BT",
    "el_GR" : "el_GR.UTF-8",
    "el_CY" : "el_CY.UTF-8",
    "en_AU" : "en_AU.UTF-8",
    "en_BW" : "en_BW.UTF-8",
    "en_CA" : "en_CA.UTF-8",
    "en_DK" : "en_DK.UTF-8",
    "en_GB" : "en_GB.UTF-8",
    "en_HK" : "en_HK.UTF-8",
    "en_IE" : "en_IE.UTF-8",
    "en_IN" : "en_IN",
    "en_NZ" : "en_NZ.UTF-8",
    "en_PH" : "en_PH.UTF-8",
    "en_SG" : "en_SG.UTF-8",
    "en_US" : "en_US.UTF-8",
    "en_ZA" : "en_ZA.UTF-8",
    "en_ZW" : "en_ZW.UTF-8",
    "eo" : "eo.UTF-8",
    "es_AR" : "es_AR.UTF-8",
    "es_BO" : "es_BO.UTF-8",
    "es_CL" : "es_CL.UTF-8",
    "es_CO" : "es_CO.UTF-8",
    "es_CR" : "es_CR.UTF-8",
    "es_DO" : "es_DO.UTF-8",
    "es_EC" : "es_EC.UTF-8",
    "es_ES" : "es_ES.UTF-8",
    "es_GT" : "es_GT.UTF-8",
    "es_HN" : "es_HN.UTF-8",
    "es_MX" : "es_MX.UTF-8",
    "es_NI" : "es_NI.UTF-8",
    "es_PA" : "es_PA.UTF-8",
    "es_PE" : "es_PE.UTF-8",
    "es_PR" : "es_PR.UTF-8",
    "es_PY" : "es_PY.UTF-8",
    "es_SV" : "es_SV.UTF-8",
    "es_US" : "es_US.UTF-8",
    "es_UY" : "es_UY.UTF-8",
    "es_VE" : "es_VE.UTF-8",
    "et_EE" : "et_EE.UTF-8",
    "eu_ES" : "eu_ES.UTF-8",
    "eu_FR" : "eu_FR.UTF-8",
    "fa_IR" : "fa_IR",
    "fi_FI" : "fi_FI.UTF-8",
    "fo_FO" : "fo_FO.UTF-8",
    "fr_BE" : "fr_BE.UTF-8",
    "fr_CA" : "fr_CA.UTF-8",
    "fr_CH" : "fr_CH.UTF-8",
    "fr_FR" : "fr_FR.UTF-8",
    "fr_LU" : "fr_LU.UTF-8",
    "fy_NL" : "fy_NL",
    "ga_IE" : "ga_IE.UTF-8",
    "gd_GB" : "gd_GB.UTF-8",
    "gez_ER" : "gez_ER",
    "gez_ET" : "gez_ET",
    "gl_ES" : "gl_ES.UTF-8",
    "gu_IN" : "gu_IN",
    "gv_GB" : "gv_GB.UTF-8",
    "he_IL" : "he_IL.UTF-8",
    "hi_IN" : "hi_IN",
    "hr_HR" : "hr_HR.UTF-8",
    "hsb_DE" : "hsb_DE.UTF-8",
    "hu_HU" : "hu_HU.UTF-8",
    "hy_AM" : "hy_AM",
    "ia" : "ia",
    "id_ID" : "id_ID.UTF-8",
    "is_IS" : "is_IS.UTF-8",
    "it_CH" : "it_CH.UTF-8",
    "it_IT" : "it_IT.UTF-8",
    "iw_IL" : "iw_IL.UTF-8",
    "ja_JP" : "ja_JP.UTF-8",
    "ka_GE" : "ka_GE.UTF-8",
    "kk_KZ" : "kk_KZ.UTF-8",
    "kl_GL" : "kl_GL.UTF-8",
    "km_KH" : "km_KH",
    "kn_IN" : "kn_IN",
    "ko_KR" : "ko_KR.UTF-8",
    "ku_TR" : "ku_TR.UTF-8",
    "kw_GB" : "kw_GB.UTF-8",
    "ky_KG" : "ky_KG",
    "lg_UG" : "lg_UG.UTF-8",
    "lo_LA" : "lo_LA",
    "lt_LT" : "lt_LT.UTF-8",
    "lv_LV" : "lv_LV.UTF-8",
    "mai_IN" : "mai_IN",
    "mg_MG" : "mg_MG.UTF-8",
    "mi_NZ" : "mi_NZ.UTF-8",
    "mk_MK" : "mk_MK.UTF-8",
    "ml_IN" : "ml_IN",
    "mn_MN" : "mn_MN",
    "mr_IN" : "mr_IN",
    "ms_MY" : "ms_MY.UTF-8",
    "mt_MT" : "mt_MT.UTF-8",
    "nb_NO" : "nb_NO.UTF-8",
    "ne_NP" : "ne_NP",
    "nl_BE" : "nl_BE.UTF-8",
    "nl_NL" : "nl_NL.UTF-8",
    "nn_NO" : "nn_NO.UTF-8",
    "no_NO" : "no_NO.UTF-8",
    "nr_ZA" : "nr_ZA",
    "nso_ZA" : "nso_ZA",
    "oc_FR" : "oc_FR.UTF-8",
    "om_ET" : "om_ET",
    "om_KE" : "om_KE.UTF-8",
    "or_IN" : "or_IN",
    "pa_IN" : "pa_IN",
    "pa_PK" : "pa_PK",
    "pl_PL" : "pl_PL.UTF-8",
    "pt_BR" : "pt_BR.UTF-8",
    "pt_PT" : "pt_PT.UTF-8",
    "ro_RO" : "ro_RO.UTF-8",
    "ru_RU" : "ru_RU.UTF-8",
    "ru_UA" : "ru_UA.UTF-8",
    "rw_RW" : "rw_RW",
    "sa_IN" : "sa_IN",
    "se_NO" : "se_NO",
    "si_LK" : "si_LK",
    "sid_ET" : "sid_ET",
    "sk_SK" : "sk_SK.UTF-8",
    "sl_SI" : "sl_SI.UTF-8",
    "so_DJ" : "so_DJ.UTF-8",
    "so_ET" : "so_ET",
    "so_KE" : "so_KE.UTF-8",
    "so_SO" : "so_SO.UTF-8",
    "sq_AL" : "sq_AL.UTF-8",
    "sr_ME" : "sr_ME",
    "sr_RS" : "sr_RS",
    "ss_ZA" : "ss_ZA",
    "st_ZA" : "st_ZA.UTF-8",
    "sv_FI" : "sv_FI.UTF-8",
    "sv_SE" : "sv_SE.UTF-8",
    "ta_IN" : "ta_IN",
    "te_IN" : "te_IN",
    "tg_TJ" : "tg_TJ.UTF-8",
    "th_TH" : "th_TH.UTF-8",
    "ti_ER" : "ti_ER",
    "ti_ET" : "ti_ET",
    "tig_ER" : "tig_ER",
    "tl_PH" : "tl_PH.UTF-8",
    "tn_ZA" : "tn_ZA",
    "tr_CY" : "tr_CY.UTF-8",
    "tr_TR" : "tr_TR.UTF-8",
    "ts_ZA" : "ts_ZA",
    "tt_RU" : "tt_RU.UTF-8",
    "uk_UA" : "uk_UA.UTF-8",
    "ur_PK" : "ur_PK",
    "uz_UZ" : "uz_UZ.UTF-8",
    "ve_ZA" : "ve_ZA",
    "vi_VN" : "vi_VN",
    "wa_BE" : "wa_BE.UTF-8",
    "wo_SN" : "wo_SN",
    "xh_ZA" : "xh_ZA.UTF-8",
    "yi_US" : "yi_US.UTF-8",
    "zh_CN" : "zh_CN.UTF-8",
    "zh_HK" : "zh_HK.UTF-8",
    "zh_SG" : "zh_SG.UTF-8",
    "zh_TW" : "zh_TW.UTF-8",
    "zu_ZA" : "zu_ZA.UTF-8",
}

country_gmt2tz = {
    ("AU",8) : "Australia/Perth",
    ("AU",9) : "Australia/Adelaide",
    ("AU",10) : "Australia/Sydney",
    ("BR",-5) : "America/Porto_Velho",
    ("BR",-4) : "America/Sao_Paulo",
    ("BR",-3) : "America/Fortaleza",
    ("CA",-9) : "America/Dawson",
    ("CA",-8) : "America/Vancouver",
    ("CA",-7) : "America/Regina",
    ("CA",-6) : "America/Winnipeg",
    ("CA",-5) : "America/Montreal",
    ("CA",-4) : "America/St_Johns",
    ("CN",5) : "Asia/Kashgar",
    ("CN",7) : "Asia/Chongqing",
    ("CN",8) : "Asia/Shanghai",
    ("MX",-8) : "America/Tijuana",
    ("MX",-7) : "America/Mexico_City",
    ("MX",-6) : "America/Cancun",
    ("MY",6) : "Asia/Kuala_Lumpur",
    ("MY",7) : "Asia/Kuching",
    ("NZ",11) : "Pacific/Auckland",
    ("NZ",12) : "Pacific/Chatham",
    ("RU",1) : "Europe/Kaliningrad",
    ("RU",2) : "Europe/Moscow",
    ("RU",3) : "Europe/Samara",
    ("RU",4) : "Asia/Omsk",
    ("RU",5) : "Asia/Novosibirsk",
    ("RU",6) : "Asia/Irkutsk",
    ("RU",8) : "Asia/Vladivostok",
    ("RU",9) : "Asia/Sakhalin",
    ("RU",10) : "Asia/Kamchatka",
    ("RU",11) : "Asia/Anadyr",
    ("US",-11) : "America/Adak",
    ("US",-10) : "America/Anchorage",
    ("US",-9) : "America/Yakutat",
    ("US",-8) : "America/Los_Angeles",
    ("US",-7) : "America/Denver",
    ("US",-6) : "America/Chicago",
    ("US",-5) : "America/New_York",
    ("US",-3) : "America/North_Dakota/Center",
}

gmt2country={
    -12 : "AS",
    -11 : "US",
    -10 : "PF",
    -9 : "CA",
    -8 : "US",
    -7 : "MX",
    -6 : "US",
    -5 : "US",
    -4 : "AR",
    -3 : "BR",
    -2 : "IS",
    -1 : "IE",
    0 : "GB",
    1 : "IT",
    2 : "EG",
    3 : "SA",
    4 : "AF",
    5 : "IN",
    6 : "SG",
    7 : "HK",
    8 : "CN",
    9 : "JP",
    10 : "AU",
    11 : "NZ",
    12 : "NZ",
}

gmt2tz={
    -12 : "Pacific/Pago_Pago",
    -11 : "Pacific/Honolulu",
    -10 : "Pacific/Tahiti",
    -9 : "America/Dawson",
    -8 : "America/Los_Angeles",
    -7 : "America/Mexico_City",
    -6 : "America/Chicago",
    -5 : "America/New_York",
    -4 : "America/Argentina/Buenos_Aires",
    -3 : "America/Bahia",
    -2 : "Atlantic/Reykjavik",
    -1 : "Europe/Dublin",
    0 : "Europe/London",
    1 : "Europe/Rome",
    2 : "Africa/Cairo",
    3 : "Asia/Riyadh",
    4 : "Asia/Kabul",
    5 : "Asia/Calcutta",
    6 : "Asia/Singapore",
    7 : "Asia/Hong_Kong",
    8 : "Asia/Shanghai",
    9 : "Asia/Tokyo",
    10 : "Australia/Sydney",
    11 : "Pacific/Auckland",
    12 : "Pacific/Chatham",
}

reserved_usernames = [
    # Static users from base-passwd/passwd.master (3.5.11).",
    "root",
    "daemon",
    "bin",
    "sys",
    "sync",
    "games",
    "man",
    "lp",
    "mail",
    "news",
    "uucp",
    "proxy",
    "www-data",
    "backup",
    "list",
    "irc",
    "gnats",
    "nobody",
    # Other static groups from base-passwd/group.master (3.5.11).",
    "adm",
    "tty",
    "disk",
    "kmem",
    "dialout",
    "fax",
    "voice",
    "cdrom",
    "floppy",
    "tape",
    "sudo",
    "audio",
    "dip",
    "operator",
    "src",
    "shadow",
    "utmp",
    "video",
    "sasl",
    "plugdev",
    "staff",
    "users",
    "nogroup",
    # Reserved usernames listed in base-passwd/README (3.5.11).",
    "netplan",
    "ftn",
    "mysql",
    "tac-plus",
    "alias",
    "qmail",
    "qmaild",
    "qmails",
    "qmailr",
    "qmailq",
    "qmaill",
    "qmailp",
    "asterisk",
    "vpopmail",
    "vchkpw",
    # Other miscellaneous system users/groups created by common packages. While",
    # it's useful to add things here that people might run into, it's not",
    # absolutely critical; the worst that will happen is that the installation",
    # will fail at some later point.",
    "Debian-exim",
    "admin",
    "bind",
    "crontab",
    "cupsys",
    "dcc",
    "dhcp",
    "dictd",
    "dovecot",
    "fetchmail",
    "firebird",
    "ftp",
    "fuse",
    "gdm",
    "haldaemon",
    "hplilp",
    "identd",
    "jwhois",
    "klog",
    "lpadmin",
    "messagebus",
    "mythtv",
    "netdev",
    "powerdev",
    "radvd",
    "saned",
    "sbuild",
    "scanner",
    "slocate",
    "ssh",
    "sshd",
    "ssl-cert",
    "sslwrap",
    "statd",
    "syslog",
    "telnetd",
    "tftpd",
]

country2tz = {
    "AD" : "Europe/Andorra",
    "AE" : "Asia/Dubai",
    "AF" : "Asia/Kabul",
    "AG" : "America/Antigua",
    "AI" : "America/Anguilla",
    "AL" : "Europe/Tirane",
    "AM" : "Asia/Yerevan",
    "AN" : "America/Curacao",
    "AO" : "Africa/Luanda",
    "AQ" : "Antarctica/South_Pole",
    "AR" : "America/Argentina/Buenos_Aires",
    "AS" : "Pacific/Pago_Pago",
    "AT" : "Europe/Vienna",
    "AU" : "Australia/Sydney",
    "AW" : "America/Aruba",
    "AX" : "Europe/Mariehamn",
    "AZ" : "Asia/Baku",
    "BA" : "Europe/Sarajevo",
    "BB" : "America/Barbados",
    "BD" : "Asia/Dhaka",
    "BE" : "Europe/Brussels",
    "BF" : "Africa/Ouagadougou",
    "BG" : "Europe/Sofia",
    "BH" : "Asia/Bahrain",
    "BI" : "Africa/Bujumbura",
    "BJ" : "Africa/Porto-Novo",
    "BM" : "Atlantic/Bermuda",
    "BN" : "Asia/Brunei",
    "BO" : "America/La_Paz",
    "BR" : "America/Sao_Paulo",
    "BS" : "America/Nassau",
    "BT" : "Asia/Thimphu",
    "BW" : "Africa/Gaborone",
    "BY" : "Europe/Minsk",
    "BZ" : "America/Belize",
    "CA" : "America/Toronto",
    "CC" : "Indian/Cocos",
    "CD" : "Africa/Kinshasa",
    "CF" : "Africa/Bangui",
    "CG" : "Africa/Brazzaville",
    "CH" : "Europe/Zurich",
    "CI" : "Africa/Abidjan",
    "CK" : "Pacific/Rarotonga",
    "CL" : "America/Santiago",
    "CM" : "Africa/Douala",
    "CN" : "Asia/Shanghai",
    "CO" : "America/Bogota",
    "CR" : "America/Costa_Rica",
    "CU" : "America/Havana",
    "CV" : "Atlantic/Cape_Verde",
    "CX" : "Indian/Christmas",
    "CY" : "Asia/Nicosia",
    "CZ" : "Europe/Prague",
    "DE" : "Europe/Berlin",
    "DJ" : "Africa/Djibouti",
    "DK" : "Europe/Copenhagen",
    "DM" : "America/Dominica",
    "DO" : "America/Santo_Domingo",
    "DZ" : "Africa/Algiers",
    "EC" : "America/Guayaquil",
    "EE" : "Europe/Tallinn",
    "EG" : "Africa/Cairo",
    "EH" : "Africa/El_Aaiun",
    "ER" : "Africa/Asmara",
    "ES" : "Europe/Madrid",
    "ET" : "Africa/Addis_Ababa",
    "FI" : "Europe/Helsinki",
    "FJ" : "Pacific/Fiji",
    "FK" : "Atlantic/Stanley",
    "FM" : "Pacific/Truk",
    "FO" : "Atlantic/Faroe",
    "FR" : "Europe/Paris",
    "GA" : "Africa/Libreville",
    "GB" : "Europe/London",
    "GD" : "America/Grenada",
    "GE" : "Asia/Tbilisi",
    "GF" : "America/Cayenne",
    "GG" : "Europe/Guernsey",
    "GH" : "Africa/Accra",
    "GI" : "Europe/Gibraltar",
    "GL" : "America/Godthab",
    "GM" : "Africa/Banjul",
    "GN" : "Africa/Conakry",
    "GP" : "America/Guadeloupe",
    "GQ" : "Africa/Malabo",
    "GR" : "Europe/Athens",
    "GS" : "Atlantic/South_Georgia",
    "GT" : "America/Guatemala",
    "GU" : "Pacific/Guam",
    "GW" : "Africa/Bissau",
    "GY" : "America/Guyana",
    "HK" : "Asia/Hong_Kong",
    "HN" : "America/Tegucigalpa",
    "HR" : "Europe/Zagreb",
    "HT" : "America/Port-au-Prince",
    "HU" : "Europe/Budapest",
    "ID" : "Asia/Jakarta",
    "IE" : "Europe/Dublin",
    "IL" : "Asia/Jerusalem",
    "IM" : "Europe/Isle_of_Man",
    "IN" : "Asia/Calcutta",
    "IO" : "Indian/Chagos",
    "IQ" : "Asia/Baghdad",
    "IR" : "Asia/Tehran",
    "IS" : "Atlantic/Reykjavik",
    "IT" : "Europe/Rome",
    "JE" : "Europe/Jersey",
    "JM" : "America/Jamaica",
    "JO" : "Asia/Amman",
    "JP" : "Asia/Tokyo",
    "KE" : "Africa/Nairobi",
    "KG" : "Asia/Bishkek",
    "KH" : "Asia/Phnom_Penh",
    "KI" : "Pacific/Enderbury",
    "KM" : "Indian/Comoro",
    "KN" : "America/St_Kitts",
    "KP" : "Asia/Pyongyang",
    "KR" : "Asia/Seoul",
    "KW" : "Asia/Kuwait",
    "KY" : "America/Cayman",
    "KZ" : "Asia/Almaty",
    "LA" : "Asia/Vientiane",
    "LB" : "Asia/Beirut",
    "LC" : "America/St_Lucia",
    "LI" : "Europe/Vaduz",
    "LK" : "Asia/Colombo",
    "LR" : "Africa/Monrovia",
    "LS" : "Africa/Maseru",
    "LT" : "Europe/Vilnius",
    "LU" : "Europe/Luxembourg",
    "LV" : "Europe/Riga",
    "LY" : "Africa/Tripoli",
    "MA" : "Africa/Casablanca",
    "MC" : "Europe/Monaco",
    "MD" : "Europe/Chisinau",
    "ME" : "Europe/Podgorica",
    "MG" : "Indian/Antananarivo",
    "MH" : "Pacific/Majuro",
    "MK" : "Europe/Skopje",
    "ML" : "Africa/Bamako",
    "MM" : "Asia/Rangoon",
    "MN" : "Asia/Hovd",
    "MO" : "Asia/Macau",
    "MP" : "Pacific/Saipan",
    "MQ" : "America/Martinique",
    "MR" : "Africa/Nouakchott",
    "MS" : "America/Montserrat",
    "MT" : "Europe/Malta",
    "MU" : "Indian/Mauritius",
    "MV" : "Indian/Maldives",
    "MW" : "Africa/Blantyre",
    "MX" : "America/Mexico_City",
    "MY" : "Asia/Kuala_Lumpur",
    "MZ" : "Africa/Maputo",
    "NA" : "Africa/Windhoek",
    "NC" : "Pacific/Noumea",
    "NE" : "Africa/Niamey",
    "NF" : "Pacific/Norfolk",
    "NG" : "Africa/Lagos",
    "NI" : "America/Managua",
    "NL" : "Europe/Amsterdam",
    "NO" : "Europe/Oslo",
    "NP" : "Asia/Katmandu",
    "NR" : "Pacific/Nauru",
    "NU" : "Pacific/Niue",
    "NZ" : "Pacific/Auckland",
    "OM" : "Asia/Muscat",
    "PA" : "America/Panama",
    "PE" : "America/Lima",
    "PF" : "Pacific/Tahiti",
    "PG" : "Pacific/Port_Moresby",
    "PH" : "Asia/Manila",
    "PK" : "Asia/Karachi",
    "PL" : "Europe/Warsaw",
    "PM" : "America/Miquelon",
    "PN" : "Pacific/Pitcairn",
    "PR" : "America/Puerto_Rico",
    "PS" : "Asia/Gaza",
    "PT" : "Europe/Lisbon",
    "PW" : "Pacific/Palau",
    "PY" : "America/Asuncion",
    "QA" : "Asia/Qatar",
    "RE" : "Indian/Reunion",
    "RO" : "Europe/Bucharest",
    "RS" : "Europe/Belgrade",
    "RU" : "Europe/Moscow",
    "RW" : "Africa/Kigali",
    "SA" : "Asia/Riyadh",
    "SB" : "Pacific/Guadalcanal",
    "SC" : "Indian/Mahe",
    "SD" : "Africa/Khartoum",
    "SE" : "Europe/Stockholm",
    "SG" : "Asia/Singapore",
    "SH" : "Atlantic/St_Helena",
    "SI" : "Europe/Ljubljana",
    "SJ" : "Atlantic/Jan_Mayen",
    "SK" : "Europe/Bratislava",
    "SL" : "Africa/Freetown",
    "SM" : "Europe/San_Marino",
    "SN" : "Africa/Dakar",
    "SO" : "Africa/Mogadishu",
    "SR" : "America/Paramaribo",
    "ST" : "Africa/Sao_Tome",
    "SV" : "America/El_Salvador",
    "SY" : "Asia/Damascus",
    "SZ" : "Africa/Mbabane",
    "TC" : "America/Grand_Turk",
    "TD" : "Africa/Ndjamena",
    "TF" : "Indian/Kerguelen",
    "TG" : "Africa/Lome",
    "TH" : "Asia/Bangkok",
    "TJ" : "Asia/Dushanbe",
    "TK" : "Pacific/Fakaofo",
    "TL" : "Asia/Dili",
    "TM" : "Asia/Ashgabat",
    "TN" : "Africa/Tunis",
    "TO" : "Pacific/Tongatapu",
    "TR" : "Europe/Istanbul",
    "TT" : "America/Port_of_Spain",
    "TV" : "Pacific/Funafuti",
    "TW" : "Asia/Taipei",
    "TZ" : "Africa/Dar_es_Salaam",
    "UA" : "Europe/Kiev",
    "UG" : "Africa/Kampala",
    "UM" : "Pacific/Midway",
    "US" : "America/New_York",
    "UY" : "America/Montevideo",
    "UZ" : "Asia/Samarkand",
    "VA" : "Europe/Vatican",
    "VC" : "America/St_Vincent",
    "VE" : "America/Caracas",
    "VG" : "America/Tortola",
    "VI" : "America/St_Thomas",
    "VN" : "Asia/Saigon",
    "VU" : "Pacific/Efate",
    "WF" : "Pacific/Wallis",
    "WS" : "Pacific/Apia",
    "YE" : "Asia/Aden",
    "YT" : "Indian/Mayotte",
    "ZA" : "Africa/Johannesburg",
    "ZM" : "Africa/Lusaka",
    "ZW" : "Africa/Harare",
}

language2lang_country = {
    "Afar (ET)" : "aa_ET",
    "Afrikaans (ZA)" : "af_ZA",
    "Amharic (ET)" : "am_ET",
    "Aragonese (ES)" : "an_ES",
    "Arabic (AE)" : "ar_AE",
    "Arabic (BH)" : "ar_BH",
    "Arabic (DZ)" : "ar_DZ",
    "Arabic (EG)" : "ar_EG",
    "Arabic (IN)" : "ar_IN",
    "Arabic (IQ)" : "ar_IQ",
    "Arabic (JO)" : "ar_JO",
    "Arabic (KW)" : "ar_KW",
    "Arabic (LB)" : "ar_LB",
    "Arabic (LY)" : "ar_LY",
    "Arabic (MA)" : "ar_MA",
    "Arabic (OM)" : "ar_OM",
    "Arabic (QA)" : "ar_QA",
    "Arabic (SA)" : "ar_SA",
    "Arabic (SD)" : "ar_SD",
    "Arabic (SY)" : "ar_SY",
    "Arabic (TN)" : "ar_TN",
    "Arabic (YE)" : "ar_YE",
    "Azerbaijani (AZ)" : "az_AZ",
    "Assamese (IN)" : "as_IN",
    "Assamese (ES)" : "ast_ES",
    "Belarusian (BY)" : "be_BY",
    "Bulgarian (BG)" : "bg_BG",
    "Bengali (BD)" : "bn_BD",
    "Bengali (IN)" : "bn_IN",
    "Breton (FR)" : "br_FR",
    "Bosnian (BA)" : "bs_BA",
    "Bosnian (ER)" : "byn_ER",
    "Catalan (AD)" : "ca_AD",
    "Catalan (ES)" : "ca_ES",
    "Catalan (FR)" : "ca_FR",
    "Catalan (IT)" : "ca_IT",
    "Cree (UA)" : "crh_UA",
    "Czech (CZ)" : "cs_CZ",
    "Czech (PL)" : "csb_PL",
    "Welsh (GB)" : "cy_GB",
    "Danish (DK)" : "da_DK",
    "German (AT)" : "de_AT",
    "German (BE)" : "de_BE",
    "German (CH)" : "de_CH",
    "German (DE)" : "de_DE",
    "German (LU)" : "de_LU",
    "Dzongkha (BT)" : "dz_BT",
    "Greek (GR)" : "el_GR",
    "Greek (CY)" : "el_CY",
    "English (AU)" : "en_AU",
    "English (BW)" : "en_BW",
    "English (CA)" : "en_CA",
    "English (DK)" : "en_DK",
    "English (GB)" : "en_GB",
    "English (HK)" : "en_HK",
    "English (IE)" : "en_IE",
    "English (IN)" : "en_IN",
    "English (NZ)" : "en_NZ",
    "English (PH)" : "en_PH",
    "English (SG)" : "en_SG",
    "English (US)" : "en_US",
    "English (ZA)" : "en_ZA",
    "English (ZW)" : "en_ZW",
    "Esperanto" : "eo",
    "Spanish (AR)" : "es_AR",
    "Spanish (BO)" : "es_BO",
    "Spanish (CL)" : "es_CL",
    "Spanish (CO)" : "es_CO",
    "Spanish (CR)" : "es_CR",
    "Spanish (DO)" : "es_DO",
    "Spanish (EC)" : "es_EC",
    "Spanish (ES)" : "es_ES",
    "Spanish (GT)" : "es_GT",
    "Spanish (HN)" : "es_HN",
    "Spanish (MX)" : "es_MX",
    "Spanish (NI)" : "es_NI",
    "Spanish (PA)" : "es_PA",
    "Spanish (PE)" : "es_PE",
    "Spanish (PR)" : "es_PR",
    "Spanish (PY)" : "es_PY",
    "Spanish (SV)" : "es_SV",
    "Spanish (US)" : "es_US",
    "Spanish (UY)" : "es_UY",
    "Spanish (VE)" : "es_VE",
    "Estonian (EE)" : "et_EE",
    "Basque (ES)" : "eu_ES",
    "Basque (FR)" : "eu_FR",
    "Persian (IR)" : "fa_IR",
    "Finnish (FI)" : "fi_FI",
    "Faroese (FO)" : "fo_FO",
    "French (BE)" : "fr_BE",
    "French (CA)" : "fr_CA",
    "French (CH)" : "fr_CH",
    "French (FR)" : "fr_FR",
    "French (LU)" : "fr_LU",
    "Frisian (NL)" : "fy_NL",
    "Irish (IE)" : "ga_IE",
    "Gaelic (GB)" : "gd_GB",
    "Gaelic (ER)" : "gez_ER",
    "Gaelic (ET)" : "gez_ET",
    "Galician (ES)" : "gl_ES",
    "Gujarati (IN)" : "gu_IN",
    "Manx (GB)" : "gv_GB",
    "Hebrew (IL)" : "he_IL",
    "Hindi (IN)" : "hi_IN",
    "Croatian (HR)" : "hr_HR",
    "Croatian (DE)" : "hsb_DE",
    "Hungarian (HU)" : "hu_HU",
    "Armenian (AM)" : "hy_AM",
    "Interlingua" : "ia",
    "Indonesian (ID)" : "id_ID",
    "Icelandic (IS)" : "is_IS",
    "Italian (CH)" : "it_CH",
    "Italian (IT)" : "it_IT",
    "Inuktitut (IL)" : "iw_IL",
    "Japanese (JP)" : "ja_JP",
    "Georgian (GE)" : "ka_GE",
    "Kazakh (KZ)" : "kk_KZ",
    "Kalaallisut (GL)" : "kl_GL",
    "Central Khmer (KH)" : "km_KH",
    "Kannada (IN)" : "kn_IN",
    "Korean (KR)" : "ko_KR",
    "Kurdish (TR)" : "ku_TR",
    "Cornish (GB)" : "kw_GB",
    "Kyrgyz (KG)" : "ky_KG",
    "Ganda (UG)" : "lg_UG",
    "Lao (LA)" : "lo_LA",
    "Lithuanian (LT)" : "lt_LT",
    "Latvian (LV)" : "lv_LV",
    "Latvian (IN)" : "mai_IN",
    "Malagasy (MG)" : "mg_MG",
    "Maori (NZ)" : "mi_NZ",
    "Macedonian (MK)" : "mk_MK",
    "Malayalam (IN)" : "ml_IN",
    "Mongolian (MN)" : "mn_MN",
    "Marathi (IN)" : "mr_IN",
    "Malay (MY)" : "ms_MY",
    "Maltese (MT)" : "mt_MT",
    "Bokmal (NO)" : "nb_NO",
    "Nepali (NP)" : "ne_NP",
    "Dutch (BE)" : "nl_BE",
    "Dutch (NL)" : "nl_NL",
    "Nynorsk (NO)" : "nn_NO",
    "Norwegian (NO)" : "no_NO",
    "Ndebele (ZA)" : "nr_ZA",
    "Ndebele (ZA)" : "nso_ZA",
    "Occitan (FR)" : "oc_FR",
    "Oromo (ET)" : "om_ET",
    "Oromo (KE)" : "om_KE",
    "Oriya (IN)" : "or_IN",
    "Panjabi (IN)" : "pa_IN",
    "Panjabi (PK)" : "pa_PK",
    "Polish (PL)" : "pl_PL",
    "Portuguese (BR)" : "pt_BR",
    "Portuguese (PT)" : "pt_PT",
    "Romanian (RO)" : "ro_RO",
    "Russian (RU)" : "ru_RU",
    "Russian (UA)" : "ru_UA",
    "Kinyarwanda (RW)" : "rw_RW",
    "Sanskrit (IN)" : "sa_IN",
    "Sami (NO)" : "se_NO",
    "Sinhala (LK)" : "si_LK",
    "Sinhala (ET)" : "sid_ET",
    "Slovak (SK)" : "sk_SK",
    "Slovenian (SI)" : "sl_SI",
    "Somali (DJ)" : "so_DJ",
    "Somali (ET)" : "so_ET",
    "Somali (KE)" : "so_KE",
    "Somali (SO)" : "so_SO",
    "Albanian (AL)" : "sq_AL",
    "Serbian (ME)" : "sr_ME",
    "Serbian (RS)" : "sr_RS",
    "Swati (ZA)" : "ss_ZA",
    "Sotho (ZA)" : "st_ZA",
    "Swedish (FI)" : "sv_FI",
    "Swedish (SE)" : "sv_SE",
    "Tamil (IN)" : "ta_IN",
    "Telugu (IN)" : "te_IN",
    "Tajik (TJ)" : "tg_TJ",
    "Thai (TH)" : "th_TH",
    "Tigrinya (ER)" : "ti_ER",
    "Tigrinya (ET)" : "ti_ET",
    "Tigrinya (ER)" : "tig_ER",
    "Tagalog (PH)" : "tl_PH",
    "Tswana (ZA)" : "tn_ZA",
    "Turkish (CY)" : "tr_CY",
    "Turkish (TR)" : "tr_TR",
    "Tsonga (ZA)" : "ts_ZA",
    "Tatar (RU)" : "tt_RU",
    "Ukrainian (UA)" : "uk_UA",
    "Urdu (PK)" : "ur_PK",
    "Uzbek (UZ)" : "uz_UZ",
    "Venda (ZA)" : "ve_ZA",
    }

#shorter list
language2lang_country = {
    "Afrikaans" : "af_ZA",
    "Amharic" : "am_ET",
    "Aragonese" : "an_ES",
    "Arabic" : "ar_AE",
    "Azerbaijani" : "az_AZ",
    "Assamese" : "as_IN",
    "Belarusian" : "be_BY",
    "Bulgarian" : "bg_BG",
    "Bengali" : "bn_BD",
    "Breton" : "br_FR",
    "Bosnian" : "bs_BA",
    "Catalan" : "ca_ES",
    "Cree" : "crh_UA",
    "Czech" : "cs_CZ",
    "Welsh" : "cy_GB",
    "Danish" : "da_DK",
    "German" : "de_DE",
    "Dzongkha" : "dz_BT",
    "Greek" : "el_GR",
    "English (GB)" : "en_GB",
    "English (US)" : "en_US",
    "Esperanto" : "eo",
    "Spanish" : "es_ES",
    "Estonian" : "et_EE",
    "Basque" : "eu_FR",
    "Persian" : "fa_IR",
    "Finnish" : "fi_FI",
    "Faroese" : "fo_FO",
    "French" : "fr_FR",
    "Frisian" : "fy_NL",
    "Irish" : "ga_IE",
    "Gaelic" : "gd_GB",
    "Galician" : "gl_ES",
    "Gujarati" : "gu_IN",
    "Manx" : "gv_GB",
    "Hebrew" : "he_IL",
    "Hindi" : "hi_IN",
    "Croatian" : "hr_HR",
    "Hungarian" : "hu_HU",
    "Armenian" : "hy_AM",
    "Interlingua" : "ia",
    "Indonesian" : "id_ID",
    "Icelandic" : "is_IS",
    "Italian" : "it_IT",
    "Inuktitut" : "iw_IL",
    "Japanese" : "ja_JP",
    "Georgian" : "ka_GE",
    "Kazakh" : "kk_KZ",
    "Kalaallisut" : "kl_GL",
    "Khmer" : "km_KH",
    "Kannada" : "kn_IN",
    "Korean" : "ko_KR",
    "Kurdish" : "ku_TR",
    "Cornish" : "kw_GB",
    "Kyrgyz" : "ky_KG",
    "Ganda" : "lg_UG",
    "Lao" : "lo_LA",
    "Lithuanian" : "lt_LT",
    "Latvian" : "lv_LV",
    "Malagasy" : "mg_MG",
    "Maori" : "mi_NZ",
    "Macedonian" : "mk_MK",
    "Malayalam" : "ml_IN",
    "Mongolian" : "mn_MN",
    "Marathi" : "mr_IN",
    "Malay" : "ms_MY",
    "Maltese" : "mt_MT",
    "Bokmal" : "nb_NO",
    "Nepali" : "ne_NP",
    "Dutch" : "nl_NL",
    "Nynorsk" : "nn_NO",
    "Norwegian" : "no_NO",
    "Ndebele" : "nr_ZA",
    "Occitan" : "oc_FR",
    "Oromo" : "om_ET",
    "Oriya" : "or_IN",
    "Panjabi" : "pa_IN",
    "Polish" : "pl_PL",
    "Portuguese (BR)" : "pt_BR",
    "Portuguese (PT)" : "pt_PT",
    "Romanian" : "ro_RO",
    "Russian" : "ru_RU",
    "Kinyarwanda" : "rw_RW",
    "Sanskrit" : "sa_IN",
    "Sami" : "se_NO",
    "Sinhala" : "si_LK",
    "Slovak" : "sk_SK",
    "Slovenian" : "sl_SI",
    "Somali" : "so_SO",
    "Albanian" : "sq_AL",
    "Serbian" : "sr_ME",
    "Swati" : "ss_ZA",
    "Sotho" : "st_ZA",
    "Swedish" : "sv_SE",
    "Tamil" : "ta_IN",
    "Telugu" : "te_IN",
    "Tajik" : "tg_TJ",
    "Thai" : "th_TH",
    "Tigrinya" : "ti_ET",
    "Tagalog" : "tl_PH",
    "Tswana" : "tn_ZA",
    "Turkish" : "tr_TR",
    "Tsonga" : "ts_ZA",
    "Tatar" : "tt_RU",
    "Ukrainian" : "uk_UA",
    "Urdu" : "ur_PK",
    "Uzbek" : "uz_UZ",
    "Venda" : "ve_ZA",
}

lang_country2language = dict([(v,k) for k,v in language2lang_country.items()])
